﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PizzaLunch
{
    /// <summary>
    /// Interaction logic for OauthVerify.xaml
    /// </summary>
    public partial class OauthVerify : Window
    {
        public string VerifyCode
        {
            get { return textVerify.Text; }
        }
        private string VerifyUrl;

        public OauthVerify(string url)
        {
            VerifyUrl = url;
            InitializeComponent();
        }

        private void btOK_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
            Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            textVerify.Text = "";
            try
            {
                wbVerify.Navigate(VerifyUrl);
            }
            catch
            {
                MessageBox.Show("Failed to verify with " + VerifyUrl);
            }
        }
    }
}
